package com.huixue.cn.ztej.constants;

import java.io.File;



public class ResourceLocator {

    /*****************************平台文件存储路径******************************/

    
	// 模板图片
	public static final String TEMPLATEIMAGE = "mc/uploadImages";
	
	// 模板图片
	public static final String TEMPLATE_ICON = "mc/templateIcons";
	
	//模板文件路径
	public static final String TEMPLATEFILES = "mc/templateFiles";
	
	public static final String TEMPLATE="mc/template";

    
    /**
     * 获取资源文件绝对路径
     * @param relateLocatin
     * @return
     */
    public static File getResourceAbsoluteLocation(String relateLocatin) {
        String parentPath = PropertiesUtils.getPropertiesValue("mc.resource.location");
        return new File(parentPath, relateLocatin);
    }
    
    /**
     * 获取资源文件绝对路径
     * @param relateLocatin
     * @return
     */
    public static String getResourceAbsoluteLocationPath(String relateLocatin) {
        return getResourceAbsoluteLocation(relateLocatin).getAbsolutePath();
    }

    public static String getResourceAbsoluteRootPath() {
        return PropertiesUtils.getPropertiesValue("wechat.resource.location");
    }

    public static File getResourceAbsoluteRootFile() {
        return new File(getResourceAbsoluteRootPath());
    }
    
    public static void main(String[] args) {
    	String absolutePath = ResourceLocator.getResourceAbsoluteLocation(ResourceLocator.TEMPLATEIMAGE).getAbsolutePath();
    	System.out.println(absolutePath);
    }
}
